From: Pranavkumar Sawargaonkar Date: Fri, 20 Sep 2013 09:52:40 +0000 (+0530) Subject: xen: arm64: Add 8250 earlyprintk support X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5855 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=93e22f8248038504be1e638abb91c6856cd16b38;p=xen.git xen: arm64: Add 8250 earlyprintk support Extracted from "Basic Platform support for APM X-Gene Storm." Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar Reworked into generic 8250 driver, use EARLY_UART_REG_SHIFT. While there observe a missing shift in the arm32 version (UART_THR is zero so it doesn't really matter). Changed for consistency. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index c27c2ebd88..aaa203ea79 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -82,6 +82,12 @@ EARLY_PRINTK_INC := 8250 EARLY_UART_BASE_ADDRESS := 0xF0406B00 EARLY_UART_REG_SHIFT := 2 endif +ifeq ($(CONFIG_EARLY_PRINTK), xgene-storm) +EARLY_PRINTK_INC := 8250 +EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0x1c020000 +EARLY_UART_REG_SHIFT := 2 +endif ifneq ($(EARLY_PRINTK_INC),) EARLY_PRINTK := y diff --git a/xen/arch/arm/arm64/debug-8250.inc b/xen/arch/arm/arm64/debug-8250.inc new file mode 100644 index 0000000000..158549a248 --- /dev/null +++ b/xen/arch/arm/arm64/debug-8250.inc @@ -0,0 +1,45 @@ +/* + * xen/arch/arm/arm64/debug-8250.inc + * + * 8250 specific debug code + * + * Copyright (c) 2013 Applied Micro. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include + +/* UART wait UART to be ready to transmit + * xb: register which contains the UART base address + * c: scratch register */ +.macro early_uart_ready xb c +1: + ldrb w\c, [\xb, #UART_LSR << EARLY_UART_REG_SHIFT] + and w\c, w\c, #UART_LSR_THRE + cmp w\c, #UART_LSR_THRE + b.ne 1b +.endm + +/* UART transmit character + * xb: register which contains the UART base address + * wt: register which contains the character to transmit */ +.macro early_uart_transmit xb wt + /* UART_THR transmit holding */ + strb \wt, [\xb, #UART_THR << EARLY_UART_REG_SHIFT] +.endm + +/* + * Local variables: + * mode: ASM + * indent-tabs-mode: nil + * End: + */